package part18;

import java.io.*;

/**
 * @author wcj
 * @Date 2021/6/3 17:30
 * @Version 1.0
 */
public class Part1810 {
    static String file = "./src/part18/Part1810.out";

    /**
     * IO流的经典使用方式之四：将输入流中的数据写入到输出流，最后定位输出到文件中
     *
     * @param args
     * @throws IOException
     */
    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new StringReader(Part187.read("./src/part18/Part1810.java")));
        PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(file)));
        int lineCount = 1;
        String s;
        while ((s = in.readLine()) != null) {
            out.println(lineCount++ + " :" + s);
        }
        out.close();
        System.out.println(Part187.read(file));
    }
}
